
= form_tag update_profile_path, multipart: true, method: :put do
  %table.table.table-bordered
    %tr
      %td{width: "170"}
        当前状态
      %td
        = current_user.readable_state
    %tr
      %td
        手机号
      %td
        = current_user.mobile
    %tr
      %td
        姓名
      %td
        - if current_user.new?
          = text_field_tag 'user[realname]', current_user.realname, class: 'form-control'
        - else
          = current_user.realname
    %tr
      %td
        身份证号
      %td
        - if current_user.new?
          = text_field_tag 'user[citizen_id]', current_user.citizen_id, class: 'form-control'
        - else
          = current_user.citizen_id
    %tr
      %td
        公司
      %td
        - if current_user.new?
          = text_field_tag 'user[company_name]', current_user.company_name, class: 'form-control'
        - else
          = current_user.company_name
    %tr
      %td
        车辆数
      %td
        - if current_user.new?
          = text_field_tag 'user[car_number]', current_user.car_number, class: 'form-control'
        - else
          = current_user.car_number
    %tr
      %td
        身份证正面（照片）
      %td
        - if current_user.new?
          = file_field_tag 'user[picture_citizen_card_front]'
        - else
          = image_tag current_user.picture_citizen_card_front.url, style: 'max-width:300px'
    %tr
      %td
        身份证反面（照片）
      %td
        - if current_user.new?
          = file_field_tag 'user[picture_citizen_card_back]'
        - else
          = image_tag current_user.picture_citizen_card_back.url, style: 'max-width:300px'
    %tr
      %td
        公司营业执照（照片）
      %td
        - if current_user.new?
          = file_field_tag 'user[picture_business_license]'
        - else
          = image_tag current_user.picture_business_license.url, style: 'max-width:300px'
    -if current_user.new?
      %tr
        %td
        %td
          =submit_tag '认证', class:'btn btn-primary'
=#link_to '认证', user_profile_modify_path, class: 'btn btn-primary btn-sm'